package com.example.elasticsearchdemo.module.location.entity;


import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @author wangjianhua
 * @Description 地点实体类
 * @date 2021/7/8/008 10:22
 */
@Document(indexName = "test")//索引名
public class Location implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
//    @Field(type = FieldType.Text)
    private String id;

    @Field(analyzer = "ik_smart")
    private String locationName;

    /**
     * 坐标 有经度纬度
     */
    private Point point;
    /**
     * 年份 测试查询
     */
    private int year;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public Point getPoint() {
        return point;
    }

    public void setPoint(Point point) {
        this.point = point;
    }


    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return "Location{" +
                "id='" + id + '\'' +
                ", locationName='" + locationName + '\'' +
                ", point=" + point +
                ", year=" + year +
                '}';
    }
}
